<template>
	<view class="niceui-flex-column width-100p">
		<view class="bg niceui-flex-column">
			<image class="banner-img" src="../../static/signin.png" mode="widthFix"></image>
			<view class="banner">
				<text class="banner-point-text">当前积分</text>
				<text class="banner-point-num">9527</text>
				<text class="banner-record-btn">积分记录</text>
			</view>
		</view>
		<view class="center-nav margin-top">
			<view class="center-nav-title">
				<text>已连续签到2天</text>
			</view>
			<view class="signin-progress-area">
				<view class="signin-days">
					<text class="bg-circle over-circle"></text>
					<text class="bg-circle over-circle"></text>
					<text class="bg-circle">+6</text>
					<text class="bg-circle">+12</text>
					<text class="bg-circle">+18</text>
					<text class="bg-circle">+24</text>
					<text class="bg-circle">+36</text>
				</view>
				<view class="signin-progress">
					<view class="signin-progress-ing" :style="{width:progressing+'%'}"></view>
					<image src="../../static/coin.png" class="signin-progress-ing-img"></image>
					<view class="signin-progress-box">
						<image src="../../static/box.png" class="signin-progress-box-img"></image>
						<text>连续签到奖励</text>
					</view>
				</view>
				<view class="signin-days">
					<text class="signin-days-text" v-for="day in signinDays">{{day}}</text>	
				</view>
			</view>
			<view class="signin-btn" @click="signin"><text class="signin-btn-text">签到</text></view>
			<view class="signin-bottom">
				<text class="signin-tip">开启连续签到提醒，轻松拥有积分兑换礼物</text>
				<switch color="#ff4338" checked style="transform:scale(0.7)"/>
			</view>
		</view>
		<view class="center-nav niceui-flex-row niceui-center niceui-between">
			<view class="niceui-flex-column padding-card">
				<view><text class="act-text strong-text">积分抽奖</text><text class="act-text">活动来了</text></view>
				<text class="other-text">中奖几率高达80% <text class="other-go">GO</text></text>
			</view>
			<image class="act-img" src="../../static/act.png" mode="widthFix"></image>
		</view>
		<view class="center-nav">
			<view class="center-nav-title">
				<text>其他任务</text>
			</view>
			<view class="center-list-item border-bottom niceui-center"
			v-for="tk in task">
				<text class="list-text">{{tk.text}}</text>
				<text class="task-text" :class="tk.state==1?'task-over':''">{{tk.point}}</text>
			</view>
		</view>
		<view class="sucPop-main" v-if="sucPop">
			<image src="../../static/sign-sus.png" mode="widthFix"></image>
			<view class="sucPop-text">
				<text class="sucPop-text-suc">领取成功</text>
				<text class="sucPop-text-point">获得6积分</text>
				<text class="sucPop-text-btn" @click="sucPop=false">确认</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				sucPop:false,
				progressing:20,
				signinDays:[
					"12/21",
					"12/22",
					"今天",
					"12/24",
					"12/25",
					"12/26",
					"12/27"
				],
				task:[
					{
						text:'每天登录小程序',
						point:'+10积分',
						state:1
					},
					{
						text:'邀请一位好友浏览',
						point:'+20积分',
						state:0
					},
					{
						text:'完成一笔订单',
						point:'+30积分',
						state:0
					},
				]
			}
		},
		methods: {
			signin() {
				//模拟签到
				console.log("签到触发")
				this.sucPop = true
				this.progressing +=15;
			}
		}
	}
</script>

<style>
	@font-face {
		font-family: texticons;
		font-weight: normal;
		font-style: normal;
		src: url('https://at.alicdn.com/t/c/font_4382910_qc8y1dij7vs.ttf?t=1703140181798') format('truetype');
	}

	page,
	view {
		display: flex;
	}

	page {
		background-color: #fff;
	}

	.niceui-flex-column {
		flex-direction: column;
	}
	.niceui-flex-row {
		flex-direction: row!important;
	}
	.niceui-center{
		align-items: center;
	}
	.niceui-between{
		justify-content: space-between;
	}
	.width-100p{
		width:100%;
	}
</style>
<style lang="scss" scoped>
	$head-color:#cd3b33;
	$white-color:#fff;
	$radius:20rpx;
	$border-color:#efefef;
	$color-1: #007aff;
	$color-2: #4cd964;
	$color-3: #f0ad4e;
	$color-4: #dd524d;
	$list-item-height:100rpx;
	$list-margin:20rpx;
	.bg{
		background-image: linear-gradient(#e65735,#eea465);
		min-height: 450rpx;
		
		.banner {
			width: 100vw;
			height: 290rpx;
			padding: 20rpx 50rpx 35rpx;
			box-sizing: border-box;
			flex-direction: column;
			justify-content: center;
			position: absolute;
			z-index: 9;
			top:0;
			
			text{
				color:#fff;
			}
		}
		.banner-point-text{
			font-size:26rpx ;
		}
		.banner-point-num{
			font-size:60rpx ;
			font-weight: bold;
			margin: 5rpx 0;
		}
		.banner-record-btn{
			font-size: 22rpx;
			width:90rpx;
			border: solid 1rpx #eee;
			border-radius: 40rpx;
			padding: 5rpx 10rpx;
		}
		.banner-img{
			width: 100%;
		}
	}
	
	
		.center-list-item {
			height: $list-item-height;
			width: 100%;
			box-sizing: border-box;
			flex-direction: row;
			padding: 0rpx 30rpx;
			
			.list-icon {
				width: 40rpx;
				height: $list-item-height;
				line-height: $list-item-height;
				font-size: 45rpx;
				color: #4cd964;
				text-align: center;
				font-family: texticons;
				margin-right: 20rpx;
			}
			.color-1{
				color:$color-1;
			}
			.color-2{
				color:$color-2;
			}
			.color-3{
				color:$color-3;
			}
			.color-4{
				color:$color-4;
			}
			
			.list-text {
				height: $list-item-height;
				line-height: $list-item-height;
				font-size: 32rpx;
				color: #555;
				flex: 1;
				text-align: left;
			}
			.task-text{
				background-color: #fe474e;
				width: 120rpx;
				height: 45rpx;
				line-height: 40rpx;
				text-align: center;
				border-radius: 60rpx;
				display: inline-block;
				font-size: 24rpx;
				color: #fff;
				margin-left: 20rpx;
			}
			.task-over{
				background-color: #f7f7f7;
				color: #999;
			}
			.navigat-arrow {
				height: $list-item-height;
				line-height: $list-item-height;
				width: 40rpx;
				font-size: 30rpx;
				color: #999;
				text-align: right;
				font-family: texticons;
			}
		}
		.border-bottom {
			border-bottom-width: 1rpx;
			border-color: $border-color;
			border-bottom-style: solid;
		}
		
	.center-nav{
		background-color: #FFFFFF;
		margin:0rpx auto $list-margin;
		width: calc(100vw - 50rpx);
		flex-direction: column;
		border-radius: $radius;
		box-shadow: 0px 1px 10px 1px rgba(0,0,0,0.1);
		
		.center-nav-title{
			padding:25rpx 30rpx;
			font-size:34rpx;
			color:#333;
			font-weight: 400;
			border-bottom: solid 1rpx $border-color;
		}
		.center-nav-content{
			height: 180rpx;
			display: flex;
			align-items: center;
		}
		.signin-progress-area{
			min-height: 230rpx;
			flex-direction: column;
			justify-content: center;
		}
		.signin-progress{
			margin:0 auto;
			width: 90%;
			height: 20rpx;
			background-color: #fff5bb;
			border-radius: 20rpx;
			position: relative;
		}
		.signin-progress-ing{
			width: 20%;
			height: 20rpx;
			background-color: #f96736;
			border-radius: 20rpx;
			position: relative;
		}
		.signin-progress-ing::after{
			// content:'\e61c';
			// font-family: texticons;
			// position: absolute;
			// z-index: 9;
			// right: -30rpx;
			// width: 50rpx;
			// height:50rpx;
			// font-size: 80rpx;
			// color:#f9d57c;
		}
		.signin-progress-ing-img{
			width: 50rpx;
			height:50rpx;
			position: relative;
			z-index: 10;
			margin-top: -15rpx;
			margin-left: -10rpx;
		}
		.signin-progress-box{
			flex-direction: column;
			height:100rpx;
			position: absolute;
			z-index: 10;
			right:-10rpx ;
			top:-20rpx;
			align-items: center;
			
			text{
				font-size: 18rpx;
				background-color: #f9d24e;
				color: #555;
				padding: 5rpx 10rpx;
				border-radius: 30rpx;
			}
		}
		.signin-progress-box-img{
			width: 60rpx;
			height:50rpx;
			position: relative;
			z-index: 10;
		}
		.signin-days{
			flex-direction: row;
			justify-content: space-around;
			width: 95%;
			margin: 0 auto;
			margin-top: 30rpx;
		}
		.signin-days-text{
			font-size: 26rpx;
			color: #888;
			width: 130rpx;
			text-align: center;
			display: inline-block;
			position: relative;
		}
		.signin-days-text::before{
			content: '';
			position: absolute;
			z-index: 9;
			top:-45rpx;
			left:45rpx;
			width: 11rpx;
			height: 11rpx;
			border-radius: 50%;
			background-color:#f96736 ;
		}
		.bg-circle{
			border-radius: 100%;
			background-color: #ffd21d;
			color: #666;
			font-size: 24rpx;
			width: 60rpx;
			height: 50rpx;
			margin: 0 auto;
			margin-bottom: 30rpx;
			text-align: center;
			padding-top:10rpx;
		}
		//todo画三角形
		.bg-circle::after{
			content:'';
			display: inline-block;
			width: 0;
			height: 0;
			border-top: 13px solid #ffd21d; 
			border-right: 13px solid transparent;
			border-left: 13px solid transparent;
			border-bottom: 13px solid transparent;
			margin-left: 6rpx;
		}
		.over-circle{
			background-color: #fff;
		}
		.over-circle::after{
			border:0px;
		}
		
		.signin-btn{
			width:390rpx;
			margin: 30rpx auto;
			background-image:linear-gradient(to right,#ff8403,#ff4338);
			border-radius: 40rpx;
			height: 70rpx;
			flex-direction: row;
			justify-content: center;
			align-items: center;
		}
		.signin-btn-text{
			color: #fff;
			font-size: 32rpx;
		}
		.signin-bottom{
			border-top: solid 1rpx #eee;
			height: 80rpx;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
			padding:0 10rpx 0 30rpx;
			box-sizing: border-box;
		}
		.signin-tip{
			font-size: 26rpx;
		}
	}
	.margin-top{
		margin-top: -185rpx;
		min-height: 230rpx;
	}
	.act-text{
		font-size: 45rpx;
		color: #333;
		font-weight: bold;
	}
	.strong-text{
		color:#fe474e;
	}
	.other-text{
		font-size: 26rpx;
		color: #888;
		margin-top: 10rpx;
	}
	.other-go{
		background-color: #fe474e;
		width: 100rpx;
		height: 40rpx;
		line-height: 40rpx;
		text-align: center;
		border-radius: 60rpx;
		display: inline-block;
		font-size: 24rpx;
		color: #fff;
		margin-left: 20rpx;
	}
	.act-img{
		width: 260rpx;
	}
	.padding-card{
		padding:35rpx 30rpx;
	}
	.sucPop-main{
		position: fixed;
		z-index: 20;
		width: 100%;
		height: 100%;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		background-color: rgba(0,0,0,0.3);
		
		image{
			width: 60%;
		}
	}
	.sucPop-text{
		position: absolute;
		z-index: 21;
		flex-direction: column;
		height: 100rpx;
		margin-top: 150rpx;
		
		text{
			text-align: center;
			color:#fff;
			font-size: 46rpx;
		}
		.sucPop-text-point{
			margin: 5rpx 0 20rpx;
			font-size: 40rpx;;
		}
		
		.sucPop-text-btn{
			background-image: linear-gradient(#f8d796,#f9dda8);
			width: 200rpx;
			height: 60rpx;
			line-height: 60rpx;
			text-align: center;
			border-radius: 60rpx;
			display: inline-block;
			font-size: 38rpx;
			color: #d4462a;
			box-shadow: 0px 1px 10px 1px rgba(0,0,0,0.1);
		}
	}
</style>